package cn.thornbird.orgsync.vo.record;

import cn.thornbird.orgsync.entity.status.UserType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class UserRecord extends SimpleUserRecord {

    private String password;

    @NotNull(message = "管理员不能为空")
    private Boolean superuser;

    @NotNull(message = "类型不能为空")
    private UserType type;

    @NotNull(message = "可用不能为空")
    private Boolean active;

    @NotNull(message = "锁定不能为空")
    private Boolean locked;

    private Date effectiveDate;

    private Date terminateDate;

    @NotNull(message = "需要更改密码不能为空")
    private Boolean needChangePassword;

    private Date passwordTerminateDate;

    @NotNull(message = "密码重试次数不能为空")
    private Integer failedLoginAttempts;

    private Date lastLoginTime;

    @Size(max = 16, message = "最后登录IP长度不符合要求")
    private String lastLoginIp;

    @Size(max = 256, message = "审核意见长度不符合要求")
    private String authorizedOpinions;

    @Size(max = 256, message = "备注长度不符合要求")
    private String remark;

}
